import { defineStore } from 'pinia';
const loginInfo = defineStore({
    id: 'md',
    state: () => ({
        name: '',
        PubKey: '',
        id : 2,
        priKey: '',
        sendType : ''
    }),
    // 开启数据缓存
    getters: {
        getName(state) {
            return state.name;
        },
        getPubKey(state) {
            return state.PubKey;
        },
        getId(state){
            return state.id;
        },
        getPriKey(state){
            return state.priKey;
        },
        getSendType(state) {
            return state.sendType;
        }
    },
    actions: {
        // setDate(name: any) {
        //     this.name = name;
        //     axios.get('http://localhost:8081/infoResMdInfo/detailinfo',{
        //         params: {
        //             Name : name.mdContact
        //         }
        //     }).then((res) => {
        //         this.subDetailinfo = res.data.data[0]
        //     })
        // },
        setName(name: any) {
            this.name = name;
        },
        setPubKey(PubKey: any) {
            this.PubKey = PubKey;
        },
        setId(id: any){
            this.id = id;
        },
        setPriKey(priKey: any){
            this.priKey = priKey;
        },
        setSendType(sendType: any){
            this.sendType = sendType;
        }
    },
    persist: true,
});

export default loginInfo;